package com.kinghood.authoritycenter.common.model.dto.organization;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.kinghood.sharding.model.KingHoodDefaultSort;
import com.kinghood.sharding.model.KingPageReqDTO;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Collections;
import java.util.Date;
import java.util.List;

/**
 * description
 *
 * @author zhangFanJun
 * @date 2023-12-18 17:54
 **/
@Data
public class OrganizationQueryReqDTO extends KingPageReqDTO implements KingHoodDefaultSort, Serializable {

    public static final String DEFAULT_COLUMN = "createTime";
    public static final String DEFAULT_Tail = "id";

    @Override
    public List<OrderItem> getDefaultSort() {
        OrderItem one = OrderItem.desc(DEFAULT_COLUMN);
        return Collections.singletonList(one);
    }

    @Override
    public List<OrderItem> getTailSort() {
        OrderItem one = OrderItem.asc(DEFAULT_Tail);
        return Collections.singletonList(one);
    }

    /**
     * 主部门id
     */
    private Long organizationId;
    /**
     * 多个部门id筛选项
     *  */
    private List<Long> organizationIdList;
    /**
     * 状态 (0：禁用 1启用)
     */
    private Integer status;
    /**
     * 真实姓名
     */
    private String realName;
    /**
     * 昵称
     */
    private String nickName;
    /**
     * 手机号
     */
    private String mobile;
    /**
     * 工号
     */
    private String jobNumber;
    /**
     * 角色id
     * */
    private Long roleId;
    /**
     * 多个角色
     *  */
    private List<Long> roleIdList;
    /**
     * 创建开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startCreateTime;
    /**
     * 创建结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endCreateTime;
    /**
     * 更新开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startUpdateTime;
    /**
     * 更新结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endUpdateTime;

}
